package com.gl.controller.file;

import com.gl.pojo.Result;
import com.gl.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
//@CrossOrigin("/*")
public class FileController {

    @Autowired
    private FileService fileService;

    @PostMapping("/upload/file")
    public Result uploadFile(String id, MultipartFile file) {
        fileService.uploadFile(id, file);
        boolean res = fileService.embedding(id, file);
        if (!res) return Result.error("文件嵌入失败");
        return Result.success();
    }

//    /**
//     * 根据音频文件创建会议
//     */
//    @PostMapping("/meeting/create/audio")

}
